package top.yocloud;

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import top.yocloud.service.HelloService;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main(String[] args) {
        // JaxWs代理工厂
        JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();
        // 设置webService请求地址
        factoryBean.setAddress("http://localhost/ws/hello");
        // 设置接口类型
        factoryBean.setServiceClass(HelloService.class);
        // 创建一个代理接口实现
        HelloService helloService = factoryBean.create(HelloService.class);
        System.out.println(helloService.getClass());
        System.out.println(helloService.sayHello("李白"));
        System.out.println(helloService.sayGoodBye("小米"));

    }
}
